package com.dalin.platform.log.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/*****************************************************************************
 * @content: 类信息                                                                                                                                *
 * @author : 那建林                                                                                                                                 *
 * @crtDate: 2012-04-24 22:52:31                                            *
 * @modDate: 2012-04-24 22:52:31                                            *
 * @version: 1.00                                                           *
 ****************************************************************************/
@Entity
@Table(name="LOG_OPERATE")
public class LogOperateEntity extends com.dalin.common.base.BaseObject {
    private Date createTime; // CREATE_TIME,7,0,null
    private String operateUserName; // OPERATE_USER_NAME,64,0,null
    private Long operateId; // OPERATE_ID,16,0,null
    private Long projectId; // PROJECT_ID,16,0,null
    private String operateIp; // OPERATE_IP,16,0,null
    private Long operateUserId; // OPERATE_USER_ID,16,0,null
    private Long logOperateId; // LOG_OPERATE_ID,16,0,null





    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="CREATE_TIME")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Column(name="OPERATE_USER_NAME")
    public String getOperateUserName() {
        return operateUserName;
    }

    public void setOperateUserName(String operateUserName) {
        this.operateUserName = operateUserName;
    }

    @Column(name="OPERATE_ID")
    public Long getOperateId() {
        return operateId;
    }

    public void setOperateId(Long operateId) {
        this.operateId = operateId;
    }

    @Column(name="PROJECT_ID")
    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

    @Column(name="OPERATE_IP")
    public String getOperateIp() {
        return operateIp;
    }

    public void setOperateIp(String operateIp) {
        this.operateIp = operateIp;
    }

    @Column(name="OPERATE_USER_ID")
    public Long getOperateUserId() {
        return operateUserId;
    }

    public void setOperateUserId(Long operateUserId) {
        this.operateUserId = operateUserId;
    }

    @Id
    @Column(name="LOG_OPERATE_ID")
    @GeneratedValue(strategy = GenerationType.TABLE,generator="generator_normal")
    @TableGenerator(
        name = "generator_normal",
        table = "GLB_GENERATOR_KEY",
        pkColumnName = "GEN_KEY",
        valueColumnName = "GEN_VALUE",
        pkColumnValue = "LOG_OPERATE",
        allocationSize=1
    )
    public Long getLogOperateId() {
        return logOperateId;
    }

    public void setLogOperateId(Long logOperateId) {
        this.logOperateId = logOperateId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof LogOperateEntity)) return false;
        final LogOperateEntity other = (LogOperateEntity) o;
        if (createTime == null) {
            if (other.createTime != null) return false;
        } else if (!createTime.equals(other.createTime)) {
            return false;
        }
        if (operateUserName == null) {
            if (other.operateUserName != null) return false;
        } else if (!operateUserName.equals(other.operateUserName)) {
            return false;
        }
        if (operateId == null) {
            if (other.operateId != null) return false;
        } else if (!operateId.equals(other.operateId)) {
            return false;
        }
        if (projectId == null) {
            if (other.projectId != null) return false;
        } else if (!projectId.equals(other.projectId)) {
            return false;
        }
        if (operateIp == null) {
            if (other.operateIp != null) return false;
        } else if (!operateIp.equals(other.operateIp)) {
            return false;
        }
        if (operateUserId == null) {
            if (other.operateUserId != null) return false;
        } else if (!operateUserId.equals(other.operateUserId)) {
            return false;
        }
        if (logOperateId == null) {
            if (other.logOperateId != null) return false;
        } else if (!logOperateId.equals(other.logOperateId)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int njlrst = 17;
        njlrst = 31 * njlrst + (createTime == null ? 0 : createTime.hashCode());
        njlrst = 31 * njlrst + (operateUserName == null ? 0 : operateUserName.hashCode());
        njlrst = 31 * njlrst + (operateId == null ? 0 : operateId.hashCode());
        njlrst = 31 * njlrst + (projectId == null ? 0 : projectId.hashCode());
        njlrst = 31 * njlrst + (operateIp == null ? 0 : operateIp.hashCode());
        njlrst = 31 * njlrst + (operateUserId == null ? 0 : operateUserId.hashCode());
        njlrst = 31 * njlrst + (logOperateId == null ? 0 : logOperateId.hashCode());
        return njlrst;
    }

}